import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/Home.vue'
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function (location) {
  return originalPush.call(this, location).catch(err => { })
};
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
  },
  {
    path:'/topList/:id?',
    component: () => import( '../views/Home/TopList/index.vue')
  },
  {
    path:'/songseets',
    component: () => import( '../views/Home/SongSeets.vue')
  },
  {
    path:'/djmusic',
    component: () => import( '../views/Home/djMusic/index.vue')
  },
  {
    path:'/singer',
    component: () => import( '../views/Home/singer/index.vue')
  },
  {
    path:'/newdisc',
    component: () => import( '../views/Home/NewDisc.vue')
  },
  {
    path: '/mymusic',
    name: 'mymusic',
    component: () => import( '../views/Mymusic.vue'),
    children:[
      {
          path:'playlist',
          component:()=>import('@/views/Mymusic/MyMusic_left.vue'),
      }
  ]
  },
  {
    path:'/sousuo',
    component: () => import( '../views/Sousuo.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router


